WORKING WITH BLOCKS

Blocks cut down on repetitive task directives, allow for logical grouping of tasks and even in play error handling.

Ansible Terminal
  block:
  - yum:
      name: "{{ item }}"
      state: latest
    with_items:
    - httpd
    - php56

  - template:
      src: templates/httpd.conf.j2
      dest: /etc/httpd/conf/httpd.conf
  when: ansible_os_family == "RedHat"